﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace DELVE_GAME.ViewStructure
{
    class Stage : ViewComposite
    {
        protected Texture2D background;

        public void setBackground(Texture2D background)
        {
            this.background = background;
        }

        public override void update()
        {
            foreach (ViewComponent vc in this.components)
            {
                vc.update();
            }
        }

        public override void draw(SpriteBatch sb)
        {
            if (this.background != null)
            {
                sb.Begin();
                sb.Draw(background, new Rectangle(0, 0, 1025, 600), Color.White);
                sb.End();
            }
            foreach (ViewComponent vc in this.components)
            {
                vc.draw(sb);
            }
        }
        public override void mouseOver(int x, int y)
        {
            foreach (ViewComponent vc in this.components)
            {
                vc.mouseOver(x,y);
            }
        }

        public override void mousePressed(int x, int y)
        {
            foreach (ViewComponent vc in this.components)
            {
                vc.mousePressed(x, y);
            }
        }

        public override void mouseReleased(int x, int y)
        {
            foreach (ViewComponent vc in this.components)
            {
                vc.mouseReleased(x, y);
            }
        }

        public override void keyPressed(Microsoft.Xna.Framework.Input.Keys key)
        {
            //base.keyPressed(key);
        }
    }
}
